﻿<controls:ChildWindow x:Class="SilentWebsite.Views.Windows.SignInChild"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           Style="{StaticResource ChildWindowStyle}"
           Height="Auto"
           Title="Sign In">
    <StackPanel x:Name="LayoutRoot" Margin="2" BindingValidationError="LayoutRootOnBindingValidationError">
        <Grid Width="320">
            <Grid.Resources>
                <Style x:Key="TextBlockStyle" TargetType="TextBlock">
                    <Setter Property="HorizontalAlignment" Value="Right" />
                    <Setter Property="Margin" Value="0,0,5,0" />
                    <Setter Property="VerticalAlignment" Value="Center" />
                    <Setter Property="Height" Value="Auto" />
                    <Setter Property="Width" Value="Auto"></Setter>
                </Style>
                <Style x:Key="TextBoxStyle" TargetType="TextBox">
                    <Setter Property="HorizontalAlignment" Value="Stretch" />
                    <Setter Property="Margin" Value="5,0,0,0" />
                    <Setter Property="VerticalAlignment" Value="Center" />
                    <Setter Property="Height" Value="Auto" />
                </Style>
                <Style x:Key="PasswordBoxStyle" TargetType="PasswordBox">
                    <Setter Property="HorizontalAlignment" Value="Stretch" />
                    <Setter Property="Margin" Value="5,0,0,0" />
                    <Setter Property="VerticalAlignment" Value="Center" />
                    <Setter Property="Height" Value="Auto" />
                </Style>
            </Grid.Resources>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="30" />
                <RowDefinition Height="30" />
            </Grid.RowDefinitions>

            <TextBlock Text="Username" Style="{StaticResource TextBlockStyle}" Grid.Row="0" Grid.Column="0" />
            <TextBlock Text="Password" Style="{StaticResource TextBlockStyle}"  Grid.Row="1" Grid.Column="0" />

            <TextBox Text="{Binding UserName, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True}" Style="{StaticResource TextBoxStyle}" Grid.Row="0" Grid.Column="1" />
            <PasswordBox Password="{Binding Password, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True}" Style="{StaticResource PasswordBoxStyle}" Grid.Row="1" Grid.Column="1" />
        </Grid>

        <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
            <Button Command="{Binding SignIn}" Content="OK" Margin="5" Width="75" />
            <Button Command="{Binding Cancel}" Content="Cancel" Margin="5" Width="75" />
        </StackPanel>
    </StackPanel>
</controls:ChildWindow>